import { createSlice } from "@reduxjs/toolkit";

const reducer = createSlice({
  // 仓库名
  name: "reducer1",
  // 仓库默认值
  initialState: {
    name: "李四",
  },
  // 修改仓库的方法
  reducers: {
    /**
     *
     * @param {*} state 仓库数据
     * @param {*} value payload 参数 ,type action类型
     */
    set_name(state, value) {
      state.name = value.payload;
    },
  },
});

export default reducer.reducer;
